"use client";
import "./index.css";
import { Card } from "antd";
import Title from "antd/es/typography/Title";
import TagList from "@/app/components/tagList";
import MdViewer from "@/app/components/MdViewer";
import useAddUserSignInRecord from "@/hooks/useAddUserSignInRecord";
import { useState } from "react";

interface Props {
  question?: API.QuestionVO;
}

/**
 * 题目卡片
 * @param props
 * @constructor
 */
const QuestionCard = (props: Props) => {
  const { question } = props;
  // 自定义签到成功钩子
  const addUserSignInRecord = useAddUserSignInRecord();
  // 今日是否已签到（null：未查询完成）
  const [hasSignedToday, setHasSignedToday] = useState<boolean | null>(null);

  const isDoSignIn = async () => {


  }

  return (
    <div className="question-card">
      <Card>
        <Title level={1} style={{ fontSize: 24 }}>
          {question?.title}
        </Title>
        <TagList tagList={question?.tagList}></TagList>
        <div style={{ marginBottom: 16 }}></div>
        <MdViewer value={question?.content}></MdViewer>
      </Card>

      <div style={{ marginBottom: 16 }}></div>
      <Card title={"推荐答案"}>
        <MdViewer value={question?.answer}></MdViewer>
      </Card>
    </div>
  );
};

export default QuestionCard;
